package com.zyx.yygh.hosp.controller;

import com.zyx.yygh.common.result.Result;
import com.zyx.yygh.hosp.service.DepartmentService;
import com.zyx.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zyx
 * @version 1.0
 * @date 2022/1/21 021 16:20
 */

@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin
public class DepartmentController {

    @Resource
    private DepartmentService departmentService;

    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){

        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);

        return Result.ok(list);
    }


}
